/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package circuit1;

/**
 *
 * @author Erik
 */
import java.util.ArrayList;

public class Oscilloscope extends Display {

    private ArrayList<Boolean> values = new ArrayList<Boolean>();
    private String valuesToShow;

    public void prod() {
        values.add(input.getValue());
        ////System.out.print("Value of " + getId() + " is: ");
        valuesToShow = "";
        if(values.size() < 10)
            for (int i = 0; i<values.size(); i++) {
                ////System.out.print(values.get(i) ? String.valueOf('1') : String.valueOf('0'));
                valuesToShow += values.get(i) ? String.valueOf('1') : String.valueOf('0'); 
                ////System.out.print(values.get(i).toString());
                if(i==10)
                    break;
            }
        else
            for (int i = values.size()-10; i<values.size(); i++) {
                ////System.out.print(values.get(i) ? String.valueOf('1') : String.valueOf('0'));
                valuesToShow += values.get(i) ? String.valueOf('1') : String.valueOf('0');
                ////System.out.print(values.get(i).toString());
            }
        ////System.out.println("");
    }
    
    public String getValuesToShow(){
        return valuesToShow;
    }

    public boolean act() {
        return input.getValue();
    }

    public void show() {

    }
}
